package com.oocl.commandProcess;

import com.oocl.printFormat.PrintFormat;

public class CommandParse {
	
	PrintFormat pf;
	
	public CommandParse(){
		pf = new PrintFormat();
	}
	
	public String parse(String command){
		String com = "";
		
		String[] coms = command.split(" ");
		if(coms.length == 3){
			if("L".equalsIgnoreCase(coms[0])){
				if("xml".equalsIgnoreCase(coms[1]) && "id".equalsIgnoreCase(coms[2])){
					com = "conmand1";
				}else if("line".equalsIgnoreCase(coms[1]) && "birth".equalsIgnoreCase(coms[2])){
					com = "command2";
				}else{
					com = "error!";
				}
			}else if("C".equalsIgnoreCase(coms[0]) && "xml".equalsIgnoreCase(coms[1]) && "id".equalsIgnoreCase(coms[2])){
				com = "command3";
			}else{
				com = "error!";
			}
		}else{
			com = "error\r\n\r\n";
		}
		
		return com;
	}
}
